diff options
author | MountainMan <43313373+MountainMan1312@users.noreply.github.com> | 2023-05-29 02:04:13 -0400 |
---|---|---|
committer | MountainMan <43313373+MountainMan1312@users.noreply.github.com> | 2023-05-29 02:04:13 -0400 |
commit | 84b379495231ec2048724a215a308e1f903df751 (patch) | |
tree | 986bebd68968188db370f836b47d444fff8f8558 | |
parent | Add `home/.sbclrc` for SBCL configuration (diff) | |
download | dotfiles.old-84b379495231ec2048724a215a308e1f903df751.tar.gz dotfiles.old-84b379495231ec2048724a215a308e1f903df751.tar.bz2 dotfiles.old-84b379495231ec2048724a215a308e1f903df751.zip |
Fix `.bashrc` for Emacs Vterm (again)
-rw-r--r-- | home/.bashrc | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/home/.bashrc b/home/.bashrc index 62d5c8e..620ea76 100644 --- a/home/.bashrc +++ b/home/.bashrc | |||
@@ -91,12 +91,29 @@ alias ls="exa -1aFghlmU --git --color=always --sort=name --time-style=iso --grou | |||
91 | 91 | ||
92 | 92 | ||
93 | ######################################################################## | 93 | ######################################################################## |
94 | # Fix for Emacs vterm | 94 | # Fixes for Emacs vterm |
95 | ##################### | 95 | ####################### |
96 | vterm_printf() { | ||
97 | if [ -n "$TMUX" ] && ([ "${TERM%%-*}" = "tmux" ] || [ "${TERM%%-*}" = "screen" ]); then | ||
98 | # Tell tmux to pass the escape sequences through | ||
99 | printf "\ePtmux;\e\e]%s\007\e\\" "$1" | ||
100 | elif [ "${TERM%%-*}" = "screen" ]; then | ||
101 | # GNU screen (screen, screen-256color, screen-256color-bce) | ||
102 | printf "\eP\e]%s\007\e\\" "$1" | ||
103 | else | ||
104 | printf "\e]%s\e\\" "$1" | ||
105 | fi | ||
106 | } | ||
107 | |||
96 | if [[ "$INSIDE_EMACS" = 'vterm' ]]; then | 108 | if [[ "$INSIDE_EMACS" = 'vterm' ]]; then |
97 | function clear() { | 109 | function clear() { |
98 | vterm_printf "51;Evterm-clear-scrollback"; | 110 | vterm_printf "51;Evterm-clear-scrollback"; |
99 | tput clear; | 111 | tput clear; |
100 | } | 112 | } |
101 | fi | 113 | fi |
114 | |||
115 | vterm_prompt_end(){ | ||
116 | vterm_printf "51;A$(whoami)@$(hostname):$(pwd)" | ||
117 | } | ||
118 | PS1=$PS1'\[$(vterm_prompt_end)\]' | ||
102 | ######################################################################## | 119 | ######################################################################## |